package com.bigShen.spring.official;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

/**
 * @author : lei.shen
 * @date : 2019/1/18
 */
public class SmallBeanFactory {

    public static void main(String[] args) {

        Resource resource = new ClassPathResource("src/applicationContext.xml");

        DefaultListableBeanFactory factory = new DefaultListableBeanFactory();

        //注册
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);

        // 定位,载入
        reader.loadBeanDefinitions(resource);

    }

}
